/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Admin
 * Date: 2022-12-02
 * Time: 19:56
 */
import java.util.*;

public class Demo2 {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        while(scan.hasNextInt()) {

            int n = scan.nextInt();
            scan.nextLine();

            for(int i = 0; i < n; i++) {
                String str = scan.nextLine();

                if(str.contains(" ") || str.contains(",")) {
                    System.out.print( "\"" +str+ "\"");
                }else {
                    System.out.print(str);
                }

                if(i < n-1) {
                    System.out.print(", ");
                }
            }
            System.out.println();
        }
    }
}
